<!doctype html>
<html>
  <head>
    <!-- for example only -->   
    <script src="../../node_modules/react/umd/react.development.js"></script>
    <script src="../../node_modules/react-dom/umd/react-dom.development.js"></script>
    <script src="../../node_modules/@babel/standalone/babel.min.js"></script>
    <!-- end -->

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" type="text/css" href="../assets/mui/css/mui.css"/>
    <script src="../assets/mui/extra/mui-react-combined.js"></script>
  </head>
  <body>
    <div class="mui-container">
      <h1>Dropdowns</h1>
      <div id="dropdowns"></div>
    </div>
    <script type="text/babel">
      let Dropdown = mui.react.Dropdown,
          DropdownItem = mui.react.DropdownItem;


      class Example1 extends React.Component {
        render() {
          return (
            <Dropdown
              color="primary"
              label="Dropdown"
              onClick={function() {console.log('option selected');}}
            >
              <DropdownItem link="#/link1">Option 1</DropdownItem>
              <DropdownItem>Option 2</DropdownItem>
              <DropdownItem>Option 3</DropdownItem>
              <DropdownItem onClick={function() {alert('Option 4 selected');}}>
                Option 4
              </DropdownItem>
            </Dropdown>
          );
        }
      }


      class Example2 extends React.Component {
        render() {
          return (
            <Dropdown alignMenu="right" color="primary" label="Dropdown">
              <DropdownItem>Option 1</DropdownItem>
              <DropdownItem>Option 2</DropdownItem>
              <DropdownItem>Option 3</DropdownItem>
              <DropdownItem>Option 4</DropdownItem>
            </Dropdown>
          );
        }
      }


      ReactDOM.render(
        <div className="mui-panel">
          <h2>React</h2>
          <Example1 />
          <Example2 />
        </div>,
        document.getElementById('dropdowns')
      );
    </script>
  </body>
</html>
